import Axios from 'axios'

const root = `http://127.0.0.1:38088`

export const URL = root

/**
 * 获取设备
 */
export function getDevice() {
  return Axios({
    url: `${root}/device=getequipmenttype"`,
  })

}

/**
 * 关闭摄像头
 */
export function closeCamera(data) {
  return Axios({
    url: `${root}/video=close`,
    method: 'POST',
    data: data
  })
}

/**
 * 获取当前图片base64（拍照）
 */
export function getPhotoBase64(data) {
  return Axios({
    url: `${root}/video=grabimage`,
    method: 'POST',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' },
    data
  })
}
